#序列化
import pickle
d=dict(name='Bob',age=20,score=88)
with open('dump.txt','wb') as f: #pickle.dump() 直接把对象序列化写入一个
    #file-like object
    pickle.dump(d,f)
    
with open('dump.txt','rb') as f:
    d=pickle.load(f)
print(d)
    
